home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2004 May / SGI IRIX 6.5 Applications 2004 May.iso / dev / java2_dev.idb / usr / demos / java2 / JNI-invocation-example / Makefile.z / Makefile
Makefile  |  2004-02-24  |  1KB  |  72 lines

  1. #!smake
  2.  
  3. # Sample Makefile to enable building invocation API example
  4. # Allows selection of ABI (n32 or 64 future) via variable SGI_ABI
  5. # Allows selection of virtual machine (classic or hotspot) via variable VM
  6. #
  7. # Example:
  8. #    make SGI_ABI=-n32 VM=hotspot
  9. #
  10.  
  11.  
  12. # Default settings of variables (if not specified on command line)
  13.  
  14. JAVA_HOME    ?= /usr/java2
  15. VM        ?= hotspot
  16. SGI_ABI        ?= -n32
  17. CLASSPATH    ?= .
  18.  
  19. LWOFF        ?= -Wl,-woff,85 -Wl,-woff,134
  20.  
  21.  
  22. # Set other variables based on those
  23.  
  24. JAVAC        = $(JAVA_HOME)/bin/javac
  25. JAVAH        = $(JAVA_HOME)/bin/javah
  26.  
  27. #if $(SGI_ABI) == "-n32"
  28. LIBDIR        = lib32
  29. SUFFIX        = n32
  30. #endif
  31.  
  32.  
  33. # target rules
  34.  
  35. #if $(SGI_ABI) == "-n32"
  36. default: all
  37. #else
  38. default:
  39.     @echo  "This release only supports the -n32 ABI"
  40. #endif
  41.  
  42. all:  run_$(SUFFIX)
  43.  
  44.  
  45. Prog.class: Prog.java
  46.     $(JAVAC) Prog.java
  47.  
  48. Prog.h: Prog.class
  49.     $(JAVAH) -jni Prog
  50.  
  51. invoke_$(SUFFIX): invoke.c Prog.h
  52.     cc $(SGI_ABI) \
  53.         -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/irix \
  54.         invoke.c \
  55.         -L$(JAVA_HOME)/$(LIBDIR)/sgi \
  56.         -L$(JAVA_HOME)/$(LIBDIR)/sgi/$(VM) \
  57.         -L$(JAVA_HOME)/$(LIBDIR)/sgi/native_threads \
  58.         -ljvm \
  59.         $(LWOFF) \
  60.         -o invoke_$(SUFFIX)
  61.  
  62. run_$(SUFFIX): invoke_$(SUFFIX) Prog.class
  63.     export VM=$(VM) ; run_it
  64.  
  65.  
  66. clean:
  67.     rm -f Prog.h
  68.  
  69. clobber: clean
  70.     rm -f Prog.class invoke_n32 invoke_64
  71.  
  72.